<html>
	<head>
	{% for style in styles %}
		<link href="/media/css/{{ style }}" rel="stylesheet" type="text/css">
	{% endfor %}
		<link rel="stylesheet" type="text/css" media="print" href="/media/css/printing.css">
		
	</head>
	<body>
		<div id="printable">
			<table class="sale_table">
				<tr>
					<th colspan="3" class="noborder"><div id="title">Nota de Venta</div></th>
				</tr>
				<tr>
					<th colspan="3"><div style="text-align:right;">Nro Venta: {{ request.sale.id }}</div></th>
				</tr>
				<tr>
					<th>Vendedor</th>
					<td>{{ request.sale.vendor.user.first_name }} {{ request.sale.vendor.user.last_name }}</td>
				</tr>
				<tr>
					<th>Comprador</th>
					<td>{{ request.sale.client.user.first_name }} {{ request.sale.client.user.last_name }}</td>
				</tr>
				<tr>
					<th>Fecha</th>
					<td>{{ request.sale.made|date:"d \de F \de Y" }}</td>
				</tr>
				<tr>
					<th>Factura/Nota emitida</th>
					<td>{{ request.sale.bill_number }}</td>
				</tr>
				<tr>
					<th>Art&iacute;culos</th>
				</tr>
				<tr>
					<td colspan="3">
						<table class="table_articles">
							<tr>
								<th>Nombre</th>
								<th>Serie</th>
								<th>Cantidad</th>
								<th>Precio</th>
							</tr>
								{% if request.articles %}
									
									{% for a in request.articles %}
										<tr>
											<td>{{ a.item.item_template.name }}</td>
											<td>{{ a.item.serial }}</td>
											<td>1</td>
											<td>{{ a.item.sale_price }} {{ a.item.currency.symbol }}</td>
										</tr>
									{% endfor %}
								{% endif %}
								{% if request.vinyls %}
									{% for v in request.vinyls %}
										<tr>
											<td>{{ v.vinyl.name }}</td>
											<td>{{ v.vinyl.code }}</td>
											<td>{{ v.quantity }} m</td>
											<td><script type="text/javascript">document.write({{v.quantity}} * {{ v.vinyl.price }});</script> {{ v.vinyl.currency.symbol }}</td>
										</tr>
									{% endfor %}
								{% endif %}
								{% if request.wheels %}
									{% for w in request.wheels %}
										<tr>
											<td>Rueda de {{ w.wheel.size }} - {{ w.trade_mark }}</td>
											<td>{{ w.codigo }}</td>
											<td>1</td>
											<td>{{ w.price }} {{ w.currency.symbol }}</td>
										</tr>
									{% endfor %}
								{% endif %}
								<tr>
									<th colspan="3">TOTAL</th>
									<td>{{ request.total|floatformat:2 }} Bs</td>
								</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
		<center><input type="button" onClick="window.print();" value="Imprimir" class="noprintable"></center>
	</body>
</html>